<template>
 输入的源串：<input v-model="msg" placeholder="输入信息" />
  <p>使用计算属性转换成倒序串：{{ computedName }}</p>
</template>

<script>
import { reactive, toRefs, computed } from 'vue'

export default {
  setup () {
    const state = reactive({
      msg: 'Hello World!'
    })
    const computedName = computed(() => {
      return state.msg.split('').reverse().join('')
    })
    return {
      ...toRefs(state),
      computedName
    }
  }
}
</script>